package org.example.score.mapper.xiangxi;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

@Mapper
public interface XiangXiMapper {

    //查询详细数据的时候查询所有有该专业的学校的数据

    //code = #{xxdm} and xnzymc=#{xnzymc}
    @Select("select * from ${tablename} where  zymc = #{xnzymc}")
    List<Map<String, Object>> selectxnzymc(@Param("tablename") String tablename, @Param("xxdm") String xxdm, @Param("xnzymc") String xnzymc);


    //code = #{xxdm} and
    @Select("select * from ${tablename} where  zymc = #{xnzymc}")
    List<Map<String, Object>> selectzymc(@Param("tablename") String tablename, @Param("xxdm") String xxdm, @Param("xnzymc") String xnzymc);




    //编写查询表的所有字段名称的语句
    //SELECT COLUMN_NAME
    //FROM INFORMATION_SCHEMA.COLUMNS
    //WHERE TABLE_SCHEMA = 'your_database_name' -- 替换为你的数据库名
    //  AND TABLE_NAME = 'your_table_name';    -- 替换为你的表名
    @Select("select column_name from information_schema.columns where table_name = #{tablename}")
    List<String> getColumnNames(@Param("tablename") String tablename);



}
